A computer you can actually understand: a Raspberry Pi Zero 2 W wired straight to a screen, a keyboard and a speaker. No hidden chips. My computer, my rules.
Work in progress: details may differ slightly between board revisions
The board is mostly copper traces. The Pi does the thinking and Linux drivers do the rest.
Zepir has no keyboard chip, no screen‑driver chip and no sound card. Your Pi talks to the screen, the keys and the speaker directly through its own pins. That only works once the Pi has been told how, which is why the software setup below matters so much.
Three stock kernel drivers, configured by device‑tree overlays: panel-mipi-dbi (DRM display), gpio-matrix-keypad (input) and PWM audio. No custom kernel modules, no userspace polling.
Until these are set up, the screen stays black, the keys do nothing and there is no sound.
| Part | What sets it up | If it is missing |
|---|---|---|
| Display | config.txt display lines and the init file zepir-st7789.bin in /lib/firmware | Black screen |
| Keyboard | An overlay (.dtbo) in overlays/ plus one dtoverlay= line | Keys do nothing |
| Sound | dtoverlay=pwm, snd_bcm2835.enable_headphones=1 in cmdline.txt, output set to headphones | No sound card |
| Console | fbcon=map:10 in cmdline.txt, small font | Text not shown on the little screen |
bootfs). Copy in config.txt, cmdline.txt, user-data and network-config, overwriting the existing ones..dtbo files into the overlays folder, and the zepir folder with zepir-st7789.bin next to the other files.network-config, and change the default password in user-data.| Login | host zepir, user pi, SSH on |
| Network | Wi‑Fi from network-config |
| Region | Europe/Bratislava, US keyboard |
| Console | autologin, no desktop |
| Sound | output set to the headphone jack |
| Font | Terminus 6x12 for the small screen |
| Display | init file copied to /lib/firmware |
| Finish | one automatic reboot |
Missed the window? Connect over SSH, for example ssh pi@zepir.local, and run:
sudo raspi-config
Expand the filesystem, enable console autologin (boot to terminal, CLI), set the audio output to the headphone jack, then Finish. Menu wording differs a little between versions. Then set the console font:
sudo dpkg-reconfigure console-setup
Enable exactly one overlay in config.txt and comment out the other:
dtoverlay=zepir-keyboard-classic #dtoverlay=zepir-keyboard-flip
Classic is the layout shown in section 3. FLIP has its own overlay and its own infographic.
dtparam=spi=on dtparam=uart0=off enable_uart=0 dtoverlay=mipi-dbi-spi,spi0-0,speed=96000000,cpol,cpha,write-only dtparam=compatible=zepir-st7789\0panel-mipi-dbi-spi dtparam=width=320,height=240,width-mm=57,height-mm=43 dtparam=dc-gpio=25 dtparam=reset-gpio=15 dtparam=backlight-gpio=14 dtoverlay=pwm dtoverlay=zepir-keyboard-classic
The serial port is switched off on purpose: its pins (TXD, RXD) are reused for display reset and backlight.
The kernel’s panel-mipi-dbi driver gives a real DRM/KMS device (/dev/dri/card0, 320×240) plus a framebuffer for the console. Only the panel’s init sequence is custom, loaded as a firmware file.
Init commands go out at 10 MHz and pixels at 96 MHz, so a fast clock cannot corrupt the setup. Orientation is MADCTL 0x68. The binary starts with the header MIPI DBI and a version byte.
Text is zepir-st7789.txt; the tool mipi-dbi-cmd from notro/panel-mipi-dbi compiles it to .bin. LVGL (DRM), SDL2 kmsdrm and Wayland can use the panel.
gpio-matrix-keypad sleeps on GPIO interrupts and scans only when a key goes down. It debounces, repeats keys and appears as a normal keyboard (/dev/input/event0, zepir_keyboard). Idle CPU is about 0.4 %, versus 17.7 % for the old Python poller.
Build an overlay from source:
dtc -@ -I dts -O dtb -o /boot/firmware/overlays/zepir-keyboard-classic.dtbo zepir-keyboard-classic.dts
dtoverlay=zepir-keyboard-classic,debounce=20 dtoverlay=zepir-keyboard-classic,norepeat
Use debounce if a key double‑types (default 10 ms). Remap single keys without rebuilding using setkeycodes or a udev hwdb entry.
Do not use audremap: it takes GPIO12 and 13, which are keyboard lines, and the keyboard driver then fails with “pin already requested”.
The speaker sits on GPIO18 via dtoverlay=pwm. Because the Zero 2 W has no jack, snd_bcm2835.enable_headphones=1 in cmdline.txt is needed for the sound card to appear.
| Screen | ls /dev/dri shows card0 |
| Keyboard | evtest lists zepir_keyboard and shows key presses |
| Sound | aplay -l lists a headphones device |
| Console | cat /sys/class/graphics/fb*/name shows which framebuffer is the panel |
Two interchangeable modules share the same signals. Use whichever you have.
| Pin | Signal | Goes to |
|---|---|---|
| 1 | GND | GND |
| 2 | 3.3 V | 3.3 V |
| 3 | SCK | Pi pin 23 |
| 4 | DATA | Pi pin 19 |
| 5 | RESET | AXP803 or RXD |
| 6 | DC | Pi pin 22 |
| 7 | CS | Pi pin 24 |
| 8 | 3.3 V (backlight) | 3.3 V |
| Pin | Signal | Goes to |
|---|---|---|
| 1 | GND | GND |
| 2 | RESET | AXP803 or RXD |
| 3 | SCL | Pi pin 23 |
| 4 | D/CX | Pi pin 22 |
| 5 | CSX | Pi pin 24 |
| 6 | SDI | Pi pin 19 |
| 7 | SDO | not used |
| 8 | GND | GND |
| 9–10 | VCC, LEDA | 3.3 V |
| 11–14 | LED_K1–4 | 10 Ω each → backlight switch |
| 15–18 | touch | not used |
Two bare copper pads. Touch them with a blob of solder and they become a wire; remove the solder and the wire is gone. They are switches you set once. On the PCB they carry no numbers, only a short text note beside each.
By default the AXP803 resets the screen at power‑up. Close the reset jumper and the Pi can reset it instead through GPIO15 (reset-gpio=15).
Software control: close the TXD jumper. High is on, low is off (backlight-gpio=14), so Linux can switch it for screen sleep.
Always on: close the “always on” jumper instead.
Generic 8‑pin module: its backlight is simply tied to 3.3 V.
Write 28 then 10 (Display Off, Sleep In) to /sys/kernel/debug/dri/spi0.0/command, and 11 then 29 to wake. Combined with the backlight pin, the panel goes fully dark.
70 keys, scanned as a matrix: 7 column lines × 10 row lines. The left half is rows 1–5, the right half rows 6–10.
Picture a grid of streets: 10 east–west row wires and 7 north–south column wires. Each key is a small bridge between one row and one column. The Pi switches the rows on one at a time and listens on the columns. If a column answers, the key at that crossing is pressed.
| Our name | GPIO | Kernel name |
|---|---|---|
| ROW1–10 | 24 16 5 19 12 20 6 26 13 21 | col-gpios, driven low |
| COL1–7 | 2 3 4 17 27 23 22 | row-gpios, pull‑ups |
The names are swapped on purpose: the kernel’s “row” is our column. Key at row j, column i sits at index i·7+j in the table.
Raspberry Pi 40‑pin header as used by Zepir, seen from above, pin 1 at top left.
Three small, separate pieces.
Both transistors share one signal, so the output flips between 3.3 V and GND with the PWM audio. The capacitor blocks DC and passes only the sound to the speaker.
The Pi Zero has no USB socket, so the USB‑A port is wired by short wires to the D+ and D− test points on the underside of the Pi.
A separate power module with an on/off button supplies 5 V to header pins 2 and 4.